<template>
	<view class="game-container">
		<view class="bold center mb10 font24">
			尊敬的XXXX您好
		</view>
		<view class="bold center mb20 font24">
			欢迎来到“178吃大皮”代理界面
		</view>
		<!-- 数据总览 -->
		<view class="box">
			<view class="bold font30 mb10">
				游戏代理数据总览
			</view>
			<view class="font28" style="line-height: 60rpx;">
				当前属性:&nbsp;{{level[infoData.actingNum]}}，二级代理:&nbsp;{{infoData['2']}}人，直属一级代理:&nbsp;{{infoData['1']}}人，直属游戏用户:&nbsp;{{infoData['0']}}人
				<br />已获得佣金总额:&nbsp;{{infoData.totalYJ}}元，上月佣金:&nbsp; {{infoData.LastMonthYJ}}元，本月充值:&nbsp;{{infoData.monthPay}}元，当前账户佣金余额:&nbsp;{{infoData.balanceYJ}}元
			</view>
		</view>
		<view class="">

		</view>
		<view class="btn">
			<!-- <tui-button type="danger" plain margin="20" class="mr20" @click="handleToPage('userSearch')">用户查询</tui-button> -->
			<tui-button type="green" plain width="150rpx" height="80rpx" size='28' margin="20" class="mr20"
				@click="handleToPage('dataSearch')">数据查询</tui-button>
			<tui-button type="blue" plain width="150rpx" height="80rpx" margin="20" size='28' class="mr20"
				@click="handleToPage('contributionRank')">贡献排行</tui-button>
			<tui-button type="warning" plain width="150rpx" height="80rpx" margin="20" size='28' class="mr20"
				@click="handleToPage('agentManage')">代理管理</tui-button>
			<tui-button type="primary" plain width="150rpx" height="80rpx" size='28' @click="goWithdraw">提现</tui-button>
		</view>
		<tui-footer copyright="代理相关问题,请咨询: XXXXXX"></tui-footer>
	</view>
</template>

<script>
	import MyButton from '@/components/MyButton/MyButton.vue';
	import {
		actingList
	} from '@/api/agent'
	export default {
		components: {
			MyButton
		},
		data() {
			return {
				infoData: {},
				level: {
					0: '无代理',
					1: '一级代理',
					2: '二级代理',
					3: '总代',
				}


			};
		},
		onShow() {
			this.getActingList()
		},
		methods: {
			getActingList() {
				actingList().then(res => {
					console.log(234, res);
					this.infoData = res.data
				})
			},
			handleToPage(urlStr) {
				uni.navigateTo({
					url: `/pages/user/gameAgent/${urlStr}`
				})
			},
			goWithdraw() {
				uni.navigateTo({
					url: `/pages/user/myWallet/myWallet`
				})
			},
		}
	}
</script>

<style lang="scss">
	.game-container {
		color: var(--txt-color-black);
		padding: 20rpx;
	}

	.box {
		background-color: #fff;
		padding: 30rpx 15px 30px;
		border-radius: 10px;
		// text-align: center;
		margin: 40px 10rpx;

		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	}

	.mr20 {
		margin-right: 20rpx;
	}

	.btn {
		display: flex;
		justify-content: space-around;
		flex-wrap: wrap;
	}
</style>